# 医生端隐形正畸
import random
import time

from base.tools import get_path, upload
from page import YxPageHome


class YxHandle(YxPageHome):
    # 点击下一步
    def click_next(self):
        self.get_next_ele().click()

    def click_fac(self):  # 点击选择加工厂
        self.get_fac_ele().click()

    def fac_choice(self, fac_name):  # 选择要的加工厂
        self.get_use_fac_ele(fac_name).click()

    def click_quick_order(self):  # 快速下单
        self.get_quick_order_ele().click()

    def send_requirement_notes(self):
        self.get_requirement_notes_ele().send_keys("需求备注嗷嗷嗷")

    def click_upload_model(self):  # 点击上传口扫
        self.get_upload_model_ele().click()

    def click_upload_upper(self):  # 上传上颌
        self.get_upload_upper_ele().click()
        upload(rf"{get_path()}\model\UpperJaw.stl")
        time.sleep(2)

    def click_upload_lower(self):  # 上传下颌
        self.get_upload_lower_ele().click()
        upload(rf"{get_path()}\model\LowerJaw.stl")
        time.sleep(2)

    def text_upload_success(self):
        self.get_upload_success_ele()
        time.sleep(2)

    def click_ok_ele(self):
        self.get_ok_ele().click()

    def click_recent_visit(self):  # 点击最近访问
        self.get_recent_visit_ele().click()

    def click_technician(self, js_name):  # 点击技师
        self.get_technician_ele(js_name).click()

    def click_submit(self):
        self.get_submit_ele().click()

    def text_submit_success(self):
        self.get_submit_success_ele()
